import Vue from 'vue'
import App from './App'
import store from './store' // store
import plugins from './plugins' // plugins
import './permission' // permission
// import BaiduMap from 'vue-baidu-map' // h5版本可以用
import uView from '@/uni_modules/uview-ui';
import globalPopup from '@/components/globalPopup/globalPopup.js';

// 微信需要全局注册组件
// #ifdef MP-WEIXIN 
import popup from '@/components/globalPopup/globalPopup.vue' 
Vue.component('popup',popup);
// #endif

import dayjs from "dayjs";
import "dayjs/locale/zh-cn";

dayjs.locale('zh-cn')

Vue.use(plugins)
Vue.use(globalPopup);

// Vue.use(BaiduMap, {
//   ak: 'ScKh6nKi0rdttud3AeF2FzBC90k5eCVS'
// })
// #ifndef MP
// 处理 wx.connectSocket promisify 兼容问题，强制返回 SocketTask
uni.connectSocket = (function(connectSocket) {
	return function(options) {
		console.log(options)
		options.success = options.success || function() {}
		return connectSocket.call(this, options)
	}
})(uni.connectSocket)
// #endif

Vue.config.productionTip = false
Vue.prototype.$store = store

App.mpType = 'app'

const app = new Vue({
  ...App
})

app.$mount()
